#include "Helper.h"

static const float _BUTTON_SELECTED_SCALE = 1.1f;

MenuItemSprite* Helper::createButton(const char* normal, const ccMenuCallback& callback)
{
	auto normalSprite = Sprite::create(normal);
	auto selectedSprite = Sprite::create(normal);
	selectedSprite->setScale(_BUTTON_SELECTED_SCALE);
	selectedSprite->setPosition(selectedSprite->getContentSize() * ((1.0f - _BUTTON_SELECTED_SCALE) * 0.5f));
	return MenuItemSprite::create(normalSprite, selectedSprite, nullptr, callback);
}


